package com.jvtd.baseProject.ui.splash;


import com.jvtd.baseProject.base.BasePresenter;
import com.jvtd.baseProject.base.MvpPresenter;
import com.jvtd.baseProject.data.DbManager;

import javax.inject.Inject;

import io.reactivex.disposables.CompositeDisposable;

/**
 * Created by Administrator on 2017/10/16.
 * splash presenter
 */

public class SplashPresenter<V extends SplashMvpView> extends BasePresenter<V>
        implements MvpPresenter<V>
{
  @Inject
  public SplashPresenter(DbManager dbManager, CompositeDisposable disposable)
  {
    super(dbManager, disposable);
  }

  @Override
  public void onAttach(V mvpView)
  {
    super.onAttach(mvpView);
    //也可以直接通过 isLogin 判断
    if (getDbManager().isStartGuidePager())
      getMvpView().openGuideActivity();
    else
      getMvpView().openMainActivity();
  }

}
